---
description: "Reference for Nitric's Python library - Returns a reference to a known version of a secret."
---

# Python - secret.version()

<Note>
  This is reference documentation for the Nitric Python SDK. To learn about
  Secrets in Nitric start with the [Secrets docs](/secrets).
</Note>

Returns a reference to a known version of a secret.

```python
from nitric.resources import secret
from nitric.application import Nitric

keyRef = secret('apiKey').allow('access')

keyValue = await keyRef.version('the-version-id')

Nitric.run()
```

## Parameters

<Properties>
  <Property name="version" required type="string">
    The version id. This value is returned from secret.put().
  </Property>
</Properties>

## Examples

### Return a reference to a known secret version

```python
from nitric.resources import secret
from nitric.application import Nitric

key_ref = secret('apiKey').allow('access')

key_value = await key_ref.version('the-version-id')

Nitric.run()
```

## See Also

- [secret.version().access()](./secret-version-access)
